#include "VertexDelclaration/GlVertexAttribute.h"
#include "../../GL/libExt/libExt.h"
namespace gname
{
	GlVertexAttribute::GlVertexAttribute( int attId , int typeSiz,void *p,int numComp, int t )
	{
		attribId      = attId;
		numComponents = numComp;
		type          = t;
		typeSize      = typeSiz;
		pointer       = p;
	}

	void GlVertexAttribute::ApplyAttrib() const
	{
		 if(attribId == 5)
		 {
			glTexCoordPointer(numComponents,type,typeSize, pointer);
			glEnableClientState(GL_TEXTURE_COORD_ARRAY);
		 }
		 
		 else
		 {
		 glVertexAttribPointerARB(attribId , numComponents, type, GL_FALSE,typeSize,  pointer);
		 glEnableVertexAttribArrayARB(attribId );
		 }
	}
}